import App from './App'
import _ from 'lodash'
import createSocket from './utils/websocket';
//使用store
import store from './store'
import Vue from 'vue'
// main.js
import uView from "uview-ui";
Vue.use(uView);
import MinRequest from '@/utils/request.js'
import minRequest from '@/utils/api.js'

Vue.use(MinRequest)
// 引入cool-uni组件库
import ClUni from "cl-uni";
Vue.use(ClUni, {
  // 进入业务单页时，页面栈只有一个，自定义导航左侧返回按钮跳转的路径
  homePage: "/"
});


Vue.config.productionTip = false
// const socket = createSocket("ws://192.168.10.18:8086", {
const socket = createSocket("ws://192.168.110.45:8086", {
  query: {},
  reconnection: true, // 启用重连
  reconnectionDelay: 1000, // 重连间隔时间
  reconnectionAttempts: Infinity, // 重连次数
  transports: ["websocket", "polling"],
  timeout: 5000,
});
Vue.prototype._ = _
Vue.prototype.$socket = socket; // 将socket挂载到Vue实例上
App.mpType = 'app'
const app = new Vue({
  minRequest,
  store,
  ...App
})
app.$mount()